<template>
  <div class="show-con">
    <div class="sh" v-show="visible">显示这个div</div>
    <button v-on:click="hid">隐藏</button>
  </div>
</template>

<script>
export default {
  props: {
    visible: {
      type: Boolean,
    },
  },
  methods: {
    hid() {
        // udpate: 这个是固定的  visible 是props中的值
      this.$emit("update:visible", false);
    },
  },
};
</script>

<style lang="less" scoped>
.show-con {
  width: 500px;
  height: 200px;
  background-color: skyblue;
  .showFlag {
    width: 500px;
    height: 100px;
    background-color: white;
  }
}
</style>